package me.may.money.command.subcommand;

import java.util.LinkedHashMap;
import java.util.Map.Entry;

import org.bukkit.command.CommandSender;
import me.may.money.api.MoneyAPI;
import me.may.money.util.SubCommand;

public class TopCommand implements SubCommand {

	@Override
	public boolean execute(CommandSender sender, String[] args) {
		if(args.length != 1) {
			sender.sendMessage("§8[§6交子§8] §e>> §c参数不正确");
			return true;
		}
		
		sender.sendMessage("§6========== §3[ §e交子排行榜TOP10 §3] §6==========");
		LinkedHashMap<String, Double> map = MoneyAPI.getTop(10);
		for (Entry<String, Double> entry : map.entrySet()) {
			sender.sendMessage("   §a§l" + entry.getValue()  + "§f两   §e-   §f" + entry.getKey());
		}
		return false;
	}

}
